package permissions

import (
	"context"
	"goAdminV1/internal/model"
	"goAdminV1/utility"

	"goAdminV1/api/permissions/v1"
)

func (c *ControllerV1) DepartmentUpdate(ctx context.Context, req *v1.DepartmentUpdateReq) (res *v1.DepartmentUpdateRes, err error) {
	err = model.DepartmentsUpdate(ctx, req)
	if err != nil {
		return nil, utility.Error(utility.CodeOperation, err)
	}
	res.Message = "部门信息更新成功"
	return res, nil
}
